<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right">
            <?php echo $this->HelpUrl('evaluationList'); ?>
        </h1>

    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box shop-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table shop-table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="40%"><?php echo $this->translate('商品名称'); ?></th>
                                <th width="10%"><?php echo $this->translate('评价数'); ?></th>
                                <th width="15%"><?php echo $this->translate('最新评价者'); ?></th>
                                <th width="20%"><?php echo $this->translate('最新评价时间'); ?></th>
                                <th width="15%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            <?php
                            $sForm = $this->searchForm;
                            $sForm->prepare();
                            ?>
                            <?php echo $this->form()->openTag($sForm); ?>
                            <tr>
                                <td>
                                    <?php echo $this->formElement($sForm->get('goods_name')); ?>
                                    <?php echo $this->formElementErrors($sForm->get('goods_name'), ['class'=>'error-message']);?>
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td>
                                    <button type="submit" class="btn btn-info btn-sm"><i class="fa fa-search"></i></button>
                                    <?php
                                    $formData = $sForm->getData();
                                    if(!empty(array_filter($formData))) { ?>
                                        &nbsp;&nbsp;<a href="<?php echo $this->url('goods-evaluation');?>" class="btn btn-default btn-sm"><i class="fa fa-reply"></i></a>
                                    <?php } $formData['sPage'] = $this->evaluationBaseList->getCurrentPageNumber(); ?>
                                </td>
                            </tr>
                            <?php echo $this->form()->closeTag(); ?>
                            </thead>
                            <tbody>
                            <?php if($this->evaluationBaseList->getCurrentItemCount() > 0) foreach ($this->evaluationBaseList as $evaluationBaseValue) { ?>
                                <tr>
                                    <td><?php echo $this->escapeHtml($evaluationBaseValue['goodsName']); ?></td>
                                    <td><?php echo $evaluationBaseValue[0]->getEvaluationCount(); ?></td>
                                    <td><?php echo $this->escapeHtml($evaluationBaseValue[0]->getEvaluationLastUser()); ?></td>
                                    <td><?php echo $this->shopDateFormat()->goodsEvaluationTime($evaluationBaseValue[0]->getEvaluationLastTime()); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('goods-evaluation',
                                            ['action'=>'showEvaluation', 'id'=>$evaluationBaseValue[0]->getGoodsId()], ['query' => $formData]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-info-circle"></i> <?php echo $this->translate('编辑查看'); ?></a>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <?php echo $this->paginationControl($this->evaluationBaseList, 'Sliding', 'layout/page', ['route' => 'goods-evaluation']); ?>
                    </div>
                </div>

            </div>
        </div>

    </section>
</div>
